package com.cyj.dream.gateway;

import cn.hutool.core.date.DateUtil;
import com.cyj.dream.core.constant.Constant;
import com.cyj.dream.swagger.annotation.EnableDreamSwagger2;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * @Description: 网关gateway启动类
 * @BelongsProject: DreamChardonnay
 * @BelongsPackage: com.cyj.dream.gateway
 * @Author: ChenYongJia
 * @CreateTime: 2021-09-27 12:42
 * @Email: chen87647213@163.com
 * @Version: 1.0
 */
@Slf4j
@EnableDreamSwagger2
@EnableDiscoveryClient
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class},scanBasePackages = {Constant.SCAN_BASE_PACKAGES_URL})
public class DreamGatewayApplication {

    /**
     * 项目启动方法
     *
     * @param args the input arguments
     * @date 2021-9-26
     * @author Sunny Chen
     */
    public static void main(String[] args) {
        log.info("梦享云--网关gateway开始启动ing！======>{}", DateUtil.now());
        // 万般尝试总算通过-- https://zhuanlan.zhihu.com/p/359849941
        SpringApplication application = new SpringApplication(DreamGatewayApplication.class);
        // 该设置方式
        application.setWebApplicationType(WebApplicationType.REACTIVE);
        application.run(args);
        log.info("梦享云--网关gateway启动成功ing.......！======>{}", DateUtil.now());
    }

}
